package bean;

import lombok.Data;

@Data
public class Result<T> {
    private Integer code;
    private String  msg;
    private T       data;

    public static <T> Result<T> ok(T data) {
        return new Result<>(200, "success", data);
    }
    public static <T> Result<T> fail(String msg) {
        return new Result<>(500, msg, null);
    }
    public Result(Integer code, String msg, T data) {
        this.code = code; this.msg = msg; this.data = data;
    }
}